package com.amoby.base.commbank.reportfile;

import java.io.File;
import java.io.IOException;
import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ReportEvents implements CommBizEvents {
    protected static final Logger logger = LoggerFactory.getLogger(ReportEvents.class);

    public static ReportEvents resolver(String path, String fileName) throws IOException {
        File file = new File(path, fileName);
        FileResolver resolver = FileResolver.build(path, fileName);
        return resolver.resolver(file);
    }
    protected String fileName         = null;
    protected String status           = null;
    protected Date   fileDate         = null;
    protected String originalFilename = null;
    protected String errCode          = null;
    protected String severityLevel    = null;
    protected String errMsg           = null;

    public boolean isSuccess() {
        return "02,03".indexOf(status) != -1;
    }

    public boolean isFail() {
        return "04,05,06,07,11".indexOf(status) != -1;
    }

    public boolean isWating() {
        return "00,03,08,10".indexOf(status) != -1;
    }

    public String getFileName() {
        return this.fileName;
    }

    public String getStatus() {
        return this.status;
    }

    public Date getFileDate() {
        return this.fileDate;
    }

    public String getOriginalFilename() {
        return this.originalFilename;
    }

    public String getErrCode() {
        return this.errCode;
    }

    public String getSeverityLevel() {
        return this.severityLevel;
    }

    public String getErrMsg() {
        return this.errMsg;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public void setFileDate(Date fileDate) {
        this.fileDate = fileDate;
    }

    public void setOriginalFilename(String originalFilename) {
        this.originalFilename = originalFilename;
    }

    public void setErrCode(String errCode) {
        this.errCode = errCode;
    }

    public void setSeverityLevel(String severityLevel) {
        this.severityLevel = severityLevel;
    }

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }
}
